package com.douyinkan.dto;

import java.time.LocalDateTime;

public class RatingDTO {
    private Long id;
    private Long contentId;
    private Integer rating;
    private LocalDateTime createdAt;

    // 构造函数
    public RatingDTO() {}

    public RatingDTO(Long id, Long contentId, Integer rating, LocalDateTime createdAt) {
        this.id = id;
        this.contentId = contentId;
        this.rating = rating;
        this.createdAt = createdAt;
    }

    // Getter和Setter方法
    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getContentId() {
        return contentId;
    }

    public void setContentId(Long contentId) {
        this.contentId = contentId;
    }

    public Integer getRating() {
        return rating;
    }

    public void setRating(Integer rating) {
        if (rating != null && (rating < 1 || rating > 5)) {
            throw new IllegalArgumentException("Rating must be between 1 and 5");
        }
        this.rating = rating;
    }

    public LocalDateTime getCreatedAt() {
        return createdAt;
    }

    public void setCreatedAt(LocalDateTime createdAt) {
        this.createdAt = createdAt;
    }
}